package com.zxq.shiluwengan.result;

public enum CodeEnum implements ICodeEnum {
    OK(true, "200", "请求成功",1),
    UNAUTHORIZED(false, "401", "未授权访问",2),
    FORBIDDEN(false, "403", "禁止访问",2),
    REQUEST_TIMEOUT(false, "408", "请求超时",2),
    INTERNAL_SERVER_ERROR(false, "500", "服务器内部错误",2),
    NOT_IMPLEMENTED(false, "501", "暂未实现",2),
    SUCCESS(true, "1000", "操作成功",1),
    DATA_NOT_FOUND(false, "1001", "数据不存在",2),
    DELETE_FAILED(false, "1002", "数据删除失败",2),
    INSERT_FAILED(false, "1003", "数据新增失败",2),
    UPDATE_FAILED(false, "1004", "数据更新失败",2),
    SOCKET_TIMEOUT(false, "1005", "接口访问超时",2),
    ENCRYPT_ERROR(false, "1101", "加密失败",2),
    DECRYPT_ERROR(false, "1102", "解密失败",2),
    PARAMS_ERROR(false, "1999", "参数异常",2),
    UNKNOWN_ERROR(false, "2000", "服务器内部错误",2),


    BLACK_USER_EXIST(false, "2001", "用户已存在",2);

    private Boolean success;
    private String code;
    private String message;
    private Integer normal;

    private CodeEnum(Boolean success, String code, String message, Integer normal) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.normal = normal;
    }

    public Boolean success() {
        return this.success;
    }

    public String code() {
        return this.code;
    }
    public Integer normal() {
        return this.normal;
    }

    public String message() {
        return this.message;
    }
}
